package com.etc.controller.system;

import com.etc.vo.system.LoginVo;
import com.etc.result.ResultBean;
import com.etc.service.system.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Main 登录控制层
 * @Author zsw
 * @Date 2019/11/30 17:32
 **/

@Controller
public class LoginController {

    @Autowired
    private ILoginService iLoginService;

    /*
    * 跳转登录页面
    * */
    @GetMapping("login")
    public String index(){
        return "system/login";
    }

    /*
     * 判断登录状态
     * */
    @PostMapping("do_login")
    @ResponseBody
    public ResultBean do_login(LoginVo loginVo){
        ResultBean login = iLoginService.login(loginVo);
        return login;
    }

}
